﻿#include "mainwindow.h"
#include "ui_mainwindow.h"

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
    , ui(new Ui::MainWindow)
{
    ui->setupUi(this);
    tableView = new TableView(this);
    model = new QStandardItemModel(5, 5, this);

    for (int row = 0; row < 5; ++row) {
        for (int col = 0; col < 5; ++col) {
            QStandardItem *item = new QStandardItem(QString("Row %1, Col %2").arg(row + 1).arg(col + 1));
            model->setItem(row, col, item);
        }
    }

    tableView->setModel(model);
    setCentralWidget(tableView);
}

MainWindow::~MainWindow()
{
    delete ui;
}

